#include <stdio.h>
#include <stdarg.h>

#include "errors.h"

static error_type_t error_code = e_ok;
static char error_message[1024] = {0};

void errors_throw(error_type_t code, const char *fmt, ...)
{
	va_list args;
	error_code = code;
	va_start(args, fmt);
	vsprintf(error_message, fmt, args);
	va_end(args);
}

error_type_t errors_code()
{
	return error_code;
}

const char *errors_message()
{
	return error_message;
}
